<?php

/**
 * @author Christoph Vieth <mail@christoph-vieth.de>
 */
if (isset($_GET['module']) && ($_GET['module'] != NULL)) {
    $moduleName = $_GET['module'];
} else {
    $moduleName = 'mobile';
}

/**
 * Module Loader
 */
switch ($moduleName) {
    case 'dial':
        include('modules/moduleDial.php');
        $module = new moduleDial();
        $module->run();
        break;
    
     case 'contacts':
        include('modules/moduleContacts.php');
        $module = new moduleContacts();
        $module->run();
        break;
    
    
    
    
    case 'mobile':
        include('modules/moduleMobile.php');
        $module = new moduleMobile();
        $module->run();
        break;
    default:
        include('modules/moduleStart.php');
        $module = new moduleStart();
        $module->run();
        break;
}

/**
 * Engine Loader
 */
switch ($module->renderEngine) {
    case 'Plain':
        include_once('classes/outputPlain.php');
        $template = new outputPlain($module->templateData);
        $template->render();
        unset($template);
        break;

    case 'JSON':
        include_once('classes/outputJSON.php');
        $template = new outputJSON($module->templateData);
        $template->render();
        unset($template);
        break;

    case 'HTML':
        include_once('classes/outputHTML.php');
        $template = new outputHTML($module->templateData);
        $template->render();
        unset($template);
        break;

    default:
        break;
}
?>